import './interfaces';
import query from './atom/db/query';

async function atom(msg: Message, headers: IHeaders) {
	const systemid = '@systemid';
	const { exec, prepare } = query(headers.actionid, headers.sessionid, headers.spaceid, systemid);
	prepare('@tname1', ['@fields'], msg);
	prepare('@tname2', ['@fields'], msg, 10, 1);
	const [table1, table2] = await exec();
	return { [table1[0]._id]: table2[0]._id };
}
